<{include file="admin:common/header.html"}>
<div class="page-title">
    <table width="100%" align="center" cellpadding="0" cellspacing="0" >
      <tr>
        <td width="30" align="right"><img src="<{$pager.url}>/images/main-h5-ico.gif" alt="" /></td>
        <th><{$MOD.title}></th>
        <td align="right"><{link ctl="case/case:index" priv="hidden" class="button"}></td>
        <td width="15"></td>
      </tr>
    </table>
</div>
<div class="page-data">
<form action="?case/case-edit.html" mini-form="case-form" method="post" ENCTYPE="multipart/form-data">
<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
    <li><a href="#table-info">基本信息</a></li>
    <li><a href="#table-attr">属性信息</a></li>
    <li><a href="#table-seo">SEO信息</a></li>
</ul>
<input type="hidden" name="case_id" value="<{$detail.case_id}>"/>
<table width="100%" border="0" cellspacing="0" class="table-data form" id="table-info">
<tr><th>标题：</th><td><input type="text" name="data[title]" value="<{$detail.title}>" class="input w-400"/></td></tr>
<tr><th class="w-100">城市：</th><td><{widget id="data/region" level=2 value=$detail.city_id}></td></tr>
<tr><th>小区：</th>
    <td>
        <input type="hidden" name="data[home_id]" id="case_home_id" value="<{$detail.home_id}>" />
        <input type="text" id="case_home_name" name="data[home_name]" value="<{$detail.home_name}>" class="input w-200"/>
        <{link ctl="home/home:dialog" select="mini:#case_home_id,#case_home_name/N/选择小区" class="button"}>
    </td>
</tr>
<tr>
    <th>户型图：</th>
    <td>
        <input type="text" name="data[huxing_id]" value="<{$detail.huxing_id}>" <{if $detail.huxing_id}>photo="<{$pager.img}>/<{$huxing.photo}>_thumb.jpg"<{/if}> id="case_huxing_id" class="input w-100" />
        <{link ctl="home/photo:dialog" class="button" id="select_huxing_btn"}>
    </td>
</tr>
<tr>
    <th>上传户型图：</th>
    <td>
       <input type="text" name="data[huxing]" value="<{$detail.huxing}>" id = 'huxing'  class="input w-200" /> &nbsp;&nbsp;&nbsp;&nbsp;<input type="file" name="data[huxing]" class="input w-100" /><span class="tip-comment">如果同时选择了户型图和上传了户型图优先上传的户型图</span>
    </td>
</tr>
<tr>
	<th>统计：</th>
	<td>
		<label>图片数:<input type="text" name="data[photos]" value="<{$detail.photos|default:'0'}>" class="input w-50"/></label>
		<label>浏览数:<input type="text" name="data[views]" value="<{$detail.views|default:'0'}>" class="input w-50"/></label>
		<label>喜欢数:<input type="text" name="data[likes]" value="<{$detail.likes|default:'0'}>" class="input w-50"/></label>
		<label>总大小:<input type="text" name="data[size]" value="<{$detail.size|default:'0'}>" class="input w-100"/> 字节</label>	
	</td>
</tr>
 <tr><th>设计思路：</th><td><textarea name="data[intro]" class="textarea"><{$detail.intro}></textarea><br /></td></tr>
<tr><th>排序：</th><td><input type="text" name="data[orderby]" value="<{$detail.orderby|default:'50'}>" class="input w-50"/></td></tr>
<tr><th>审核：</th><td>
	<label><input type="radio" name="data[audit]" <{if $detail.audit}>checked="checked"<{/if}> value="1"/>是</label>&nbsp;&nbsp;
	<label><input type="radio" name="data[audit]" <{if empty($detail.audit)}>checked="checked"<{/if}> value="0"/>否</label></td></tr>
    <tr><th class="clear-th-bottom"></th><td class="clear-td-bottom" colspan="10"><input type="submit" class="bt-big" value="提交数据" /></td></tr>
</table>

<table width="100%" border="0" cellspacing="0" class="table-data form" id="table-seo" style="display:none;">
<tr><th>seo_title：</th><td><input type="text" name="data[seo_title]" value="<{$detail.seo_title}>" class="input w-500"/></td></tr>
<tr><th>seo_keywords：</th><td><input type="text" name="data[seo_keywords]" value="<{$detail.seo_keywords}>" class="input w-500"/></td></tr>
<tr><th>seo_description：</th><td><textarea name="data[seo_description]" class="textarea"><{$detail.seo_description}></textarea><br /></td></tr>
<tr><th class="clear-th-bottom"></th><td class="clear-td-bottom" colspan="10"><input type="submit" class="bt-big" value="提交数据" /></td></tr>
</table>  

<table width="100%" border="0" cellspacing="0" class="table-data form" id="table-attr" style="display:none;">
<{widget id="attr/form" from="zx:case" value=$detail.attrvalues }>
<tr><th class="clear-th-bottom"></th><td class="clear-td-bottom" colspan="10"><input type="submit" class="bt-big" value="提交数据" /></td></tr>
</table>
</form>
</div>
<script type="text/javascript">
(function(K, $){
$("div.page-data").tabs();
$("#select_home_btn").click(function(e){
	e.stopPropagation(); e.preventDefault();
    var home_id = $("#case_home_id").val();
	var link = $(this).attr("action") || $(this).attr("href");
	Widget.Dialog.Select(link, 'N', function(ret){
        $("#case_home_id").val(ret[0]);
        $("#case_home_name").val(ret[1].title);
	}, {title:"请选择小区",width:700});
});
$("#select_company_btn").click(function(e){
	e.stopPropagation(); e.preventDefault();
	var link = $(this).attr("action") || $(this).attr("href");
	Widget.Dialog.Select(link, 'N', function(ret){
        $("#case_company_id").val(ret[0]);
        $("#case_company_name").val(ret[1].title);
	}, {title:"请选择装修公司",width:700});
});
$("#select_huxing_btn").click(function(e){
	e.stopPropagation(); e.preventDefault();
    var home_id = $("#case_home_id").val();
    if(!$.isNumeric(home_id)){
        Widget.MsgBox.error("请先选择小区");
        return false;
    }
	var link = $(this).attr("action") || $(this).attr("href");
    link += "&SO[home_id]="+home_id;
	Widget.Dialog.Select(link, 'N', function(ret){
        $("#case_huxing_id").val(ret[0]);
        $("#case_huxing_id").attr("photo", "<{$pager.img}>/"+ret[1].photo+"_thumb.jpg");
		$("#huxing").val(ret[1].photo);
	}, {title:"请选择户型图",width:700});
});
})(window.KT, window.jQuery);
</script>
<{include file="admin:common/footer.html"}>